import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

// 后台子路由

Vue.use(VueRouter)

const routes = [
    // {
    //     path: '/',
    //     name: 'Home',
    //     component: Home
    // },
    {
        path: '/',
        name: 'Login',
        component: () => import("../views/Login.vue")
    },
    {
        path: '/registered',
        name: 'Registered',
        component: () => import("../views/Registered.vue")
    },
    {
        path: '/task',
        name: 'Task',
        component: () => import("../views/Task.vue")
    },
    {
        path: '/admin',
        name: 'Admin',
        component: () => import("../views/Admin.vue"),
        children: [
            {path: 'user', component: () => import("../components/admin/User.vue")},
            {path: 'dash', component: () => import("../components/admin/Dash.vue")},
            {path: 'sort', component: () => import("../components/admin/Sort.vue")},
            {path: 'topic', component: () => import("../components/admin/Topic.vue")},
            {path: 'grades', component: () => import("../components/admin/Grades.vue")},
            {path: 'cloud-config', component: () => import("../components/admin/CloudConfig.vue")},
            {path: 'monitor-info', component: () => import("../components/admin/MonitorInfo.vue")}
        ]
    },
    {
        path: '/message',
        name: 'Message',
        component: () => import("../views/Message.vue")
    },
    {
        path: '/answer',
        name: 'Answer',
        component: () => import("../views/Answer.vue")
    }, {
        path: '/monitor',
        name: 'Monitor',
        component: () => import("../views/Monitor.vue")
    }, {
        path: '/autoweb',
        name: 'autoWeb',
        component: () => import('../views/AutoWeb')
    }
]

const router = new VueRouter({
    routes
})

export default router
